package sql;

import org.apache.flink.table.functions.FunctionRequirement;
import org.apache.flink.table.functions.TableFunction;
import org.apache.flink.types.Row;

import java.util.Set;

/**
 * UDTF
 */
public class Split extends TableFunction<Row> {

    private String separator = ",";

    public Split() {
    }

    public Split(String separator) {
        this.separator = separator;
    }

    public void eval(String line){
        for (String s : line.split(separator)) {
            collect(Row.of(s));
        }
    }

}
